function maxLength(element, limit) {
	if (element.value.length >= limit) {
		element.value = element.value.substring(0, limit - 1);
	}
}

function toUpperCase(element) {
	element.style.textTransform="uppercase";
	element.value = element.value.toUpperCase();
}

function modal(elementId) {
	element = document.getElementById(elementId);
	element.style.visibility = (element.style.visibility = "hidden" ? "visible" : "hidden");
	element.style.display = (element.style.display = "none" ? "block" : "none");
}

function modalShow(element) {
	element.style.visibility = (element.style.visibility = "hidden" ? "visible" : "hidden");
	element.style.display = (element.style.display = "none" ? "block" : "none");
}

function modalHide(element) {
	element.style.visibility = (element.style.visibility = "visible" ? "hidden" : "visible");
	element.style.display = (element.style.display = "block" ? "none" : "block");
}

